package com.ohuang.fakescreen.window

import android.app.Activity
import android.view.View
import android.view.WindowManager

class BlackSmallWindow(activity: Activity) : SmallWindow(activity) {
    val black: Int = 0xff000000.toInt()
    override fun createSmallView(): View {
        var smallView = View(activity)
        smallView.setBackgroundColor(black)
        smallView.setOnClickListener {
            hideSmallWindow()
        }
        return smallView
    }

    override fun initLayoutParam(layoutParams: WindowManager.LayoutParams): WindowManager.LayoutParams {
        layoutParams.width = 4000
        layoutParams.height = 4000
        layoutParams.flags =
            layoutParams.flags or WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS or WindowManager.LayoutParams.FLAG_FULLSCREEN or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
        layoutParams.flags =
            layoutParams.flags or WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
        return layoutParams
    }
}